#ifndef GAMESTATE_H_
#define GAMESTATE_H_

/* Abstract base class to uniform the gamestate management technique 
 * The Game singleton abstracts all of its updating and drawing to a gamestate 
 * which internally manage what is active and what is not 
 */

class Camera;
struct ID3DXEffect;
class Vec3;
class BPhysicsEngine;
#include <LuaPlus.h>

class GameState
{
public:
    GameState()
    {
        m_initialised = false;
    }
    virtual ~GameState()		= 0{}
public:
	virtual void Update(float dt)		= 0;
	virtual void Draw()			= 0;
	virtual void Initialise()	= 0;
	virtual void CleanUp()		= 0{}
	virtual void OnResume()		= 0{}
    const bool IsInitialised() const
    {
        return m_initialised;
    }
    virtual Camera* GetCamera() = 0;
    virtual ID3DXEffect* GetEffect() = 0;
    virtual BPhysicsEngine* GetPhysicsEngine() = 0;
    virtual void NotifyKeyPressDirectInput(int which) = 0{}
    virtual void NotifyKeyPressSDL(int type, int state, int key) = 0{}
    virtual void HandleMessage(const char* message) = 0{}
    virtual void DebugDrawSphere(const Vec3& pos, float radius,const Vec3& color, bool fullSize){}
    virtual void DebugDrawHemiSphere(const Vec3& pos, float radius, const Vec3& norm, const Vec3& color, bool fullSize){}

public:
	bool m_initialised;
};

#define VIEW_MATRIX (Engine::Instance()->GetCurrentState()->GetCamera()->GetViewMatrix())
#define PROJ_MATRIX (Engine::Instance()->GetCurrentState()->GetCamera()->GetProjectionMatrix())
#endif